1. The Field of the Invention
The present invention is directed to writing multimedia data to a storage medium and, more particularly, to the buffering of streamed multimedia data in a manner that enables the streamed multimedia data to be accessed from a file even while the file is being written to.
2. Related Technology
The advent of broadcasting data in a digital format has allowed for many conveniences not previously considered practical for the VCR. For instance, digital data can be recorded and indexed on a hard disk or another mass storage device, thereby enabling the recorded data to be accessed promptly, without requiring the data to be fast-forwarded and rewound in the sequential and time-consuming manner that is required when storing the data on traditional videocassettes. Another general benefit provided by digital data is that writing and reading digital data to a storage medium can occur simultaneously, such that the viewer can access previously recorded data without interrupting the recording of new data.
One drawback of digital data, however, is that it is file-based, such that data within a designated file typically cannot be accessed and utilized until the entire contents of the file have been received. Recently, however, certain standards have been developed which enable file-based data to be encoded in a streaming format, so that the data can be accessed and read at the same time it is being received, and without first requiring the entire contents of the streamed data file to be received. Examples of the various standards and formats for streaming data include MPEG (Moving Picture Experts Group), ASF (Advanced Streaming Format), AVI (Audio Video Interleave), Active Movie and QuickTime.
Employing such a streaming format allows the streamed data to be accessed and viewed prior to receiving the entire contents of the stream. Devices such as Programmable Video Recorders (PVRs) further allow a viewer to alter the manner in which the streamed data is viewed. PVRs enable these features using ring buffers. Ring buffers, which are well known to those of ordinary skill in the art, comprise temporary storage of a predetermined size in which the oldest stored data is overwritten with the most recently received data. The ring buffer enables the PVR to store data as it is received even though the PVR is playing other data at the same time. A PVR having a ring buffer also enables a viewer to temporarily pause the play of a program, while the program is continuously recorded to the ring buffer, wherein upon resuming the play of the program, the viewer can watch the content that was recorded into the ring buffer during the temporary pause of the play.
Other VCR-like features that PVRs offer viewers are replaying a program segment, fast forwarding or rewinding through a program and viewing the stream from previously bookmarked locations (such as the start of a show). All these features require interrupting the viewing of the program stream, seeking to another point in the stream and resuming the viewing from that point. For example, to replay a program segment, the PVR must stop displaying the current program, jump back a certain duration, say 5 seconds, in the program stream and start displaying the program stream from that point on. In order to do this efficiently, the ring buffer must be indexed. An index associates time instants with the data in the program stream that is normally displayed at that time instant.
One limitation of streamed data, however, is that only certain formats of streamed data can be stored in a ring buffer. In particular, it is not practical to write streamed data having appended indexes and discrete headers, such as ASF data, into a ring buffer. Overwriting a portion of an ASF data file may corrupt or make inaccessible the entire contents of the data file, even though only a portion of the file is overwritten. Accordingly, it is not practical to overwrite ASF data in a traditional ring buffer. One solution to overcome this limitation, may include a buffer that is comprised of several files, as disclosed in U.S. patent application Ser. No. 10/175,208, filed on Jun. 19, 2002, entitled “Programmable Video Recorder Backing Store For Non-Byte Stream Formats,” which is incorporated herein by reference. According to the incorporated patent disclosure, one of the several files included within a buffer may be discarded when the buffer is full so that data can be written to a new file that is added to the buffer, instead of overwriting data within a single file of a ring buffer and thereby making all of the data within the ring buffer inaccessible.
Another limitation of certain streamed data, specifically streamed data such as ASF data that must be recorded with appended indexes, is that the recorded data can only be accessed after the file is complete (e.g., writing to the file has stopped) and the index has been appended to the file. The index is not appended to a ‘live’ file (e.g., a file that is being written to) because the data section of the file is continuously growing. If the index were appended to the end of a live file then the index would have to be shifted and rewritten several times to accommodate the growth of the data section, which is an expensive operation.
Accordingly, the functionality of a PVR, which stores ASF data or similarly formatted streamed data in the ring buffer, is correspondingly limited to the predetermined size of the files that are used to buffer the data in the PVR. For instance, if the size of the ASF files which are used to buffer the incoming data have the capacity to store five minutes of content, then the PVR will not be able to seek and replay the most recently received content that is contained in the ‘live’ file (up to five minutes worth of content). Only after the file is complete and the index of the file is appended to the file can the recorded content be accessed from the file.
Accordingly, as the capacity of the files that are used to buffer the ASF data increases, the duration of content that may be inaccessible to the viewer at any given time also increases. However, the problems associated with buffering ASF data cannot simply be remedied by decreasing the holding capacity of the storage files. In particular, as the capacity of the files decreases, the frequency in which file indexes must be created and appended to the files conversely increases, thereby decreasing the overall efficiency of buffering the data.
Accordingly, there currently exists a need in the art for improved methods and systems for buffering streamed data, such as ASF data, that is stored in file formats that include appended indexes.